//////////////////////////////////////////////////////////////////////////////////
//	File	:	Game.h
//	Author	:	Yuri Oyoko
//	Purpose	:	Controls the main game loop and switches states
//////////////////////////////////////////////////////////////////////////////////
#pragma once

//Includes
#include "BaseState.h"
#include "MainMenuState.h"
#include "SGD Wrappers/CSGD_Direct3D.h"
#include "SGD Wrappers/CSGD_DirectInput.h"
#include "SGD Wrappers/CSGD_DirectSound.h"
#include "SGD Wrappers/CSGD_TextureManager.h"
#include "SGD Wrappers/CSGD_WaveManager.h"


class Game
{
private:
	BaseState* CurrentGameState;
	CSGD_Direct3D*			Direct3DInstance;
	CSGD_DirectInput*		DirectInputInstance;
	CSGD_DirectSound*		DirectSoundInstance;
	CSGD_TextureManager*	TextureManagerInstance;
	CSGD_WaveManager*		WaveManagerInstance;
	
	bool	IsWindowed;
	float	theElapsedTime;
	Game();
	Game& operator=(const Game&);
	~Game();

	//FPS counter
	DWORD dwFrames;
	DWORD dwCurrentTime;
	DWORD dwLastUpdateTime;
	DWORD dwElapsedTime;
	char szFPS[32];
public:
	//Returns the instance of the Game class
	static Game* GetInstance();
	//Initializes the game class and any other variables that need to be set
	void Initialize(HWND hWnd, HINSTANCE hInstance, bool WindowedMode);
	//The main game loop
	bool Main();
	//Shutdown the game
	void Shutdown();
	//Changes the current state of the game
	void ChangeState(BaseState* newState);
	//Gets input from the user
	void GetInput();
	//Returns the current FPS
    char* GetFPS(){return szFPS;}

};